Repository navigation
Require pymysql[rsa]>=1.2.4 so use_tls=False connections log in to MySQL 8 - #1756
Open
dimitri-yatsenko wants to merge 2 commits into
Open
dimitri-yatsenko wants to merge 2 commits into
dimitri-yatsenko wants to merge 2 commits into
Conversation
Since 2.3.6, use_tls=False disables TLS on MySQL. Without TLS, a MySQL 8 login with caching_sha2_password or sha256_password needs the cryptography package whenever the server has no cached login for the account. PyMySQL's rsa extra installs it. PyMySQL 1.2.1 to 1.2.3 fail that login even with cryptography, so the minimum moves to 1.2.4. Adds an integration test that logs in without TLS as a new caching_sha2_password account. Updates pixi.lock and the conda recipe example in RELEASE_MEMO.md. Fixes #1750
dimitri-yatsenko
requested review from
MilagrosMarin,
lum-agilyti and
ttngu207
November 24, 2026 21:50
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pymysql[rsa]>=1.2.4instead ofpymysql>=1.1.1. Thersaextra installscryptography.pixi.lock: pymysql 1.2.4 and cryptography in every environment.use_tls=Falseas a newcaching_sha2_passwordaccount, so the server has no cached login and the full password exchange runs without TLS.RELEASE_MEMO.md.Why
Since 2.3.6,
use_tls=Falsedisables TLS on MySQL; in 2.3.5 the connection still used TLS. Without TLS, PyMySQL needs thecryptographypackage to log in with MySQL 8's default authentication (caching_sha2_password, alsosha256_password) whenever the server has no cached login for the account: a new account, or after a server restart,FLUSH PRIVILEGES, or a password change. datajoint did not depend oncryptography, so such logins failed withRuntimeError: 'cryptography' package is required ....PyMySQL 1.2.1, 1.2.2 and 1.2.3 fail the same login even with
cryptographyinstalled (AttributeError: 'NoneType' object has no attribute 'is_auth_switch_request'). 1.2.0 and 1.2.4 work. The new minimum of 1.2.4 skips those releases and keeps the CVE-2024-36039 fix that the old minimum was for.The new test fails without
cryptographyand with PyMySQL 1.2.3, and passes with this change. PostgreSQL connections are not affected.Release note
Since 2.3.6,
use_tls=Falsedisables TLS on MySQL connections. Without TLS, logging in to MySQL 8 withcaching_sha2_passwordorsha256_passwordneeds thecryptographypackage and PyMySQL 1.2.4 or later. DataJoint 2.3.7 installs both (pymysql[rsa]>=1.2.4).Packaging
The conda-forge recipe must make the same change:
pymysql >=1.2.4andcryptography(PyMySQL'srsaextra asks forcryptography>=46.0.7; conda has no extras, so list it directly).Fixes #1750